﻿<div ng-controller="freezeEnterpriseController">
    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-inverse">
                <div class="panel-heading">
                    <div class="panel-heading-btn">
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default"
                           data-click="panel-expand"><i class="fa fa-expand"></i></a>
                    </div>
                    <h4 class="panel-title">冻结企业管理</h4>
                </div>
                <div class="panel-body">
                    <div class="form-inline filter-option">
                        <div class="row">
                            <div class="col-md-12">
                                <!--<div class="pull-left">
                                    <button class="btn btn-info" ng-click="exportExcel()">信息导出（Excel）</button>
                                </div>-->
                                <div class="pull-right">
                                    <input type="text" ng-model="filter.keyword" class="form-control input-sm"
                                           placeholder="关键词"/>
                                    <span>
                                        <input type="radio" name="checked" ng-checked="filter.isAlive" value="1"
                                               ng-model="filter.isAlive" ng-change="reflash()"> 未冻结
                                        <input type="radio" name="checked" value="-2" ng-model="filter.isAlive"
                                               ng-change="reflash()"> 已冻结
                                    </span>
                                    <button class="btn btn-sm btn-info" ng-click="reflash()"><i
                                            class="fa fa-search"></i> 筛选
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div>
                        <table id="data-table" ng-table="tableParams" template-pagination="template/pagination.html"
                               class="table table-striped table-bordered table-hover table-condensed">
                            <tr ng-repeat="item in $data">
                                <td data-title="'序号'" width="10%" class="text-center">{{ first + $index }}</td>
                                <td data-title="'企业名称'" class="text-center">{{ item.enterprise_name }}</td>
                                <td data-title="'营业执照注册号'" class="text-left">{{ item.credential_number }}</td>
                                <td ng-if="filter.isAlive == 1" data-title="'联系人'" class="text-left">{{
                                    item.contact_person}}
                                </td>
                                <td ng-if="filter.isAlive == 1" data-title="'联系电话'" class="text-left">{{
                                    item.contact_phone}}
                                </td>
                                <td ng-if="filter.isAlive == -2" data-title="'冻结时间'" class="text-left">{{
                                    item.freeze_time | date :'yyyy-MM-dd HH:mm:ss'}}
                                </td>
                                <td ng-if="filter.isAlive == -2" data-title="'冻结原因'" class="text-left">{{
                                    item.freeze_description}}
                                </td>
                                <td data-title="'审核通过时间'" class="text-left">{{ item.passed_time | date :'yyyy-MM-dd HH:mm:ss'}}
                                </td>

                                <td class="text-center width-100 text-nowrap">
                                    <button class="btn btn-info btn-xs" ng-click="read(item)"><i class="fa fa-edit"></i>
                                        详细
                                    </button>
                                    <button ng-if="filter.isAlive == 1" class="btn btn-info btn-xs"
                                            ng-click="freeze(item)"><i
                                            class="fa fa-edit"></i> 冻结
                                    </button>
                                    <button ng-if="filter.isAlive == -2" class="btn btn-info btn-xs"
                                            ng-click="unfreeze(item)"><i
                                            class="fa fa-edit"></i> 解除冻结
                                    </button>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="modal fade" id="modal-read">
                    <div class="modal-dialog" style="width:1100px">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                <h4 class="modal-title"><i class="fa fa-lg fa-edit text-success"></i>资料详情</h4>
                            </div>
                            <div class="modal-body">
                                <div class="form-horizontal">
                                    <ng-form name="editForm" novalidate>

                                        <div class="form-group width-full">
                                            <label class="col-md-2 control-label">企业名称: </label>
                                            <div class="col-md-4 form-control-static">
                                                {{ model.enterprise_name }}
                                            </div>
                                        </div>

                                        <div class="form-group width-full">
                                            <label class="col-md-2 control-label">营业执照注册号: </label>
                                            <div class="col-md-4 form-control-static">
                                                {{ model.credential_number }}
                                            </div>
                                        </div>
                                        <hr/>
                                        <div class="form-group width-full">
                                            <label class="col-md-2 control-label">联系人: </label>
                                            <div class="col-md-4 form-control-static">
                                                {{ model.contact_person }}
                                            </div>
                                            <label class="col-md-2 control-label">联系电话: </label>
                                            <div class="col-md-4 form-control-static">
                                                {{ model.contact_phone }}
                                            </div>
                                        </div>
                                        <hr/>
                                        <div class="form-group width-full">
                                            <div class="form-group width-full">
                                                <div class="col-sm-4 form-control-static ">
                                                    <label class="control-label"> 营业执照: </label>

                                                    <div class="tb-booth tb-pic tb-s250">
                                                        <img class="jqzoom"
                                                             src="{{model.credential_photo_address}}"
                                                             rel="{{model.credential_photo_address}}" alt="图片不存在"/>

                                                    </div>
                                                </div>

                                                <div class="col-sm-4 form-control-static">
                                                    <label class="control-label">法人身份证正面: </label>

                                                    <div class="tb-booth tb-pic tb-s250">

                                                        <img class="jqzoom"
                                                             src="{{model.artificial_person_front_photo_address}}"
                                                             rel="{{model.artificial_person_front_photo_address}}"
                                                             alt="图片不存在"/>
                                                    </div>
                                                </div>

                                                <div class="col-sm-4 form-control-static ">
                                                    <label class=" control-label">法人身份证反面: </label>

                                                    <div class="tb-booth tb-pic tb-s250">
                                                        <img class="jqzoom"
                                                             src="{{model.artificial_person_back_photo_address}}"
                                                             rel="{{model.artificial_person_back_photo_address}}"
                                                             alt="图片不存在"/>
                                                    </div>
                                                </div>
                                                <div class="clearfix"></div>

                                            </div>
                                        </div>
                                    </ng-form>
                                </div>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-sm btn-white" data-dismiss="modal"><i
                                        class="fa fa-share-square-o"></i> 关闭
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal fade" id="modal-freeze">
                    <div class="modal-dialog" style="width:1100px">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                <h4 class="modal-title"><i class="fa fa-lg fa-edit text-success"></i>资料详情</h4>
                            </div>
                            <div class="modal-body">
                                <div class="row">
                                    <div class="form-horizontal">
                                        <ng-form name="editForm" novalidate>
                                            <div class="form-group width-full">
                                                <label class="control-label col-md-2"> 企业名称：</label>
                                                <div class="col-md-10 ">
                                                    {{model.enterprise_name}}
                                                </div>
                                            </div>
                                            <div class="form-group width-full">
                                                <label class="control-label col-md-2"> 冻结原因：</label>

                                                <div class=" col-md-5 ">
                                                    <input type="radio" name="reason" ng-checked="option.id == 0" value="0"
                                                           ng-model="option.id" ng-click="changeOption()">
                                                    违规操作
                                                </div>
                                                <div class="col-md-5">
                                                    <label class="control-label col-md-2">
                                                        <input type="radio" name="reason"  value="1"
                                                               ng-model="option.id" >
                                                        其他原因：
                                                    </label>
                                                    <div class="col-md-10">
                                                        <textarea class="form-control" ng-disabled="option.id != 1"
                                                                  ng-model="model.description"></textarea>
                                                    </div>
                                                </div>
                                            </div>
                                        </ng-form>
                                    </div>
                                </div>

                            </div>
                            <div class="modal-footer">
                                <button class="btn btn-sm btn-danger" ng-click="confirmFreeze()"
                                        ng-disabled="editForm.$invalid"><i class="fa fa-save"></i> 冻结
                                </button>

                                <button type="button" class="btn btn-sm btn-white" data-dismiss="modal"><i
                                        class="fa fa-share-square-o"></i> 关闭
                                </button>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>